package com.mycharx.springboothibernate.service.impl;

import com.mycharx.springboothibernate.dao.SsoUserDao;
import com.mycharx.springboothibernate.entity.SsoUser;
import com.mycharx.springboothibernate.repository.SsoUserRepository;
import com.mycharx.springboothibernate.service.SsoUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * The type Sso user service.
 *
 * @author 张卜亢
 * @date 2020.03.27 23:21:40
 */
@Service
@Transactional(rollbackFor = {Exception.class})
public class SsoUserServiceImpl implements SsoUserService {
    @Resource
    private SsoUserDao ssoUserDao;

    @Resource
    private SsoUserRepository ssoUserRepository;

    @Override
    public List<SsoUser> findAll() {
        return ssoUserDao.findAll();
    }

    @Override
    public SsoUser saveOrUpdate(SsoUser ssoUser) {
        return ssoUserRepository.save(ssoUser);
    }
}
